from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column,Integer,String
from App.ext import db

class FlyInfo(db.Model):
    __tablename__ = 'wbdflightlist' #表名
    id = Column(Integer,primary_key=True) #字段，整形，主键 column是导入的
    searchDepartureAirport = Column(String(134217728))
    searchArrivalAirport = Column(String(134217728))
    airCode = Column(String(134217728))
    arrAirport = Column(String(134217728))
    arrAirportCode = Column(String(134217728))
    arrDate = Column(String(134217728))
    arrTerminal = Column(String(134217728))
    arrTime = Column(String(134217728))
    cabin = Column(String(134217728))
    date = Column(String(134217728))
    depAirport = Column(String(134217728))
    depAirportCode = Column(String(134217728))
    depDate = Column(String(134217728))
    depTerminal = Column(String(134217728))
    depTime = Column(String(134217728))
    distance = Column(String(134217728))
    flightTime = Column(String(134217728))
    fullName = Column(String(134217728))
    mainCarrierFullName = Column(String(134217728))
    mealDesc = Column(String(134217728))
    name = Column(String(134217728))
    planeFullType = Column(String(134217728))
    planeType = Column(String(134217728))
    shortCarrier = Column(String(134217728))
    shortName = Column(String(134217728))
    minPrice = Column(String(134217728))
    code = Column(String(134217728))
    flightType = Column(String(134217728))
    discountStr = Column(String(134217728))
    def to_json(self):
        dict = self.__dict__
        if "_sa_instance_state" in dict:
            del dict["_sa_instance_state"]
        return dict